// 3. 负责人：历史管理器（支持撤销）
public class History
{
  private readonly Stack<TextMemento> _history = new();

  public void Push(TextMemento memento)
  {
    _history.Push(memento);
  }

  public TextMemento Pop()
  {
    return _history.Pop();
  }

  public bool HasHistory => _history.Count > 0;
}